package com.wunu.zn.api.appliance.service;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import net.sf.json.JSONObject;
@Service
public class MapDevAuthKeyCached implements IDevMessageCached {

	private final static Logger log = LoggerFactory.getLogger(MapDevAuthKeyCached.class);
	
	private Map<String,Object> chahedMap = new ConcurrentHashMap<String, Object>();

	public void set(String devId, String obj) {
		log.debug("map set cached auth devId, devId:{}", devId);
		chahedMap.put(devId, obj);
	}

	public String get(String devId) {
		return chahedMap.get(devId).toString();
	}

	public void remove(String devId) {
		log.debug("map remove cached auth devId, devId:{}.", devId);
		chahedMap.remove(devId);
	}

}
